package threePart.exception;

public class ChainTest {
    public static void main(String[] args) {
        ChainTest ct = new ChainTest();
        try {
            ct.test2();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    // 喝大了异常
    public void test1() throws DrunkException {
        throw new DrunkException("喝车别开酒！");
    }

    public void test2() {
        try {
            test1();
        } catch (DrunkException e) {
            // e.printStackTrace();
            // RuntimeException newExc = new RuntimeException("司机一滴酒，亲人两行泪~~");
            RuntimeException newExc = new RuntimeException(e);
            // newExc.initCause(e);
            throw newExc;
        }
    }
}
